package main

import (
	"fmt"
	"gorm-study/src/pkg/student/models"
	"gorm-study/src/pkg/utils/dbutil"
)

func main() {
	var deleteStudent models.Student
	deleteStudent.ID = 3
	deleteResult := dbutil.DB.Delete(&deleteStudent)
	fmt.Printf("删除条数：%v \n", deleteResult.RowsAffected)

	var student models.Student
	result := dbutil.DB.First(&student, 3)
	fmt.Printf("删除后查询 ID 为 3 的记录，数量：%v \n", result.RowsAffected)
}
